package com.sixseven.interceptor;

import com.sixseven.bean.Member;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Belly
 * @version 1.1.0
 */
public class AdminInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        Member member = (Member) request.getSession().getAttribute("member");
        if (member != null && member.getStatus() == 1){
            return true;
        }
        return false;
    }
}
